﻿@model RatesViewModel
@{
    ViewBag.Title = "Rates";
    Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}
<!--start add new part-->
<div class="add_new_zatify_user rates_content">
    @using (Html.BeginForm("SaveProximityRaduises", "Rates"))
    {
        <fieldset>
            <legend>
                <h4>
                    Proximity Radius Rates</h4>
            </legend>
            <div class="rates_content">
                <div class="zatify_table_content cms_dafults_content">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <th width="48%">
                                Radius
                            </th>
                            <th width="37%">
                                Rate Per Push
                            </th>
                            <th width="15%">
                                Fixed Cost
                            </th>
                        </tr>
                        @for (int i = 0; i < Model.ProximityRadiuses.Count; i++)
                        {
                            if (!Model.ProximityRadiuses[i].IsCustomRate)
                            {
                            <tr>
                                <td>
                                    @Html.HiddenFor(m => m.ProximityRadiuses[i].ProximityRadiusId)
                                    @Html.HiddenFor(m => m.ProximityRadiuses[i].FromRadius)
                                    @Html.HiddenFor(m => m.ProximityRadiuses[i].ToRadius)
                                    @Html.HiddenFor(m => m.ProximityRadiuses[i].IsCustomRate)
                                    @if (Model.ProximityRadiuses[i].ProximityRadiusId == 13)
                                    {
                                        <text>Over 200 @Model.ProximityRadiuses[i].RadiusUnits</text>
                                    }
                                    else
                                    {
                                        <text>@Model.ProximityRadiuses[i].ToRadius @Model.ProximityRadiuses[i].RadiusUnits</text>
                                    }
                                </td>
                                <td>
                                    @Html.EditorFor(m => m.ProximityRadiuses[i].RatePerPush)
                                </td>
                                <td>
                                    @Html.EditorFor(m => Model.ProximityRadiuses[i].FixedCost)
                                </td>
                            </tr>
                            }
                            else
                            {
                            <tr>
                                <td>
                                    @Html.HiddenFor(m => m.ProximityRadiuses[i].ProximityRadiusId)
                                    @Html.HiddenFor(m => m.ProximityRadiuses[i].IsCustomRate)
                                    <label style="border-bottom: 1px solid #666; padding-bottom: 5px; width: 100%;">
                                        Custom Range</label><br />
                                    <br />
                                    @Html.EditorFor(m => m.ProximityRadiuses[i].FromRadius)
                                    @Html.EditorFor(m => m.ProximityRadiuses[i].ToRadius) miles
                                </td>
                                <td>
                                    @Html.EditorFor(m => m.ProximityRadiuses[i].RatePerPush)
                                </td>
                                <td>
                                    @Html.EditorFor(m => Model.ProximityRadiuses[i].FixedCost)
                                </td>
                            </tr>
                            }
                        }
                    </table>
                </div>
                <div class="zatify_panel_btn" style="margin-top: 10px;">
                    <input name="" type="submit" class="btn apps_btn apps_gray_btn" value="Save" />
                    <a href="@Url.Action("List", "Rates")">
                        <input name="" type="button" class="btn apps_btn apps_gray_btn" value="Cancel" />
                    </a>
                </div>
            </div>
        </fieldset>
    }
    @using (Html.BeginForm("SaveBaseCostTimings", "Rates"))
    {
        <fieldset>
            <legend>
                <h4>
                    Base Cost and Timing Rates</h4>
            </legend>
            <div class="rates_content">
                <div class="zatify_table_content cms_dafults_content">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <th width="48%">
                                Timing
                            </th>
                            <th width="37%">
                                Rate Per Push
                            </th>
                            <th width="15%">
                                Fixed Cost
                            </th>
                        </tr>
                        @for (int i = 0; i < Model.BaseCostTimings.Count(); i++)
                        {
                            <tr>
                                <td>
                                    @Html.HiddenFor(m => m.BaseCostTimings[i].BaseCostTimingId)
                                    @Html.HiddenFor(m => m.BaseCostTimings[i].Timing)
                                    @Model.BaseCostTimings[i].Timing
                                </td>
                                <td>
                                    @Html.EditorFor(m => m.BaseCostTimings[i].RatePerPush)
                                </td>
                                <td>
                                    @Html.EditorFor(m => m.BaseCostTimings[i].FixedCost)
                                </td>
                            </tr>
                        }
                    </table>
                </div>
                <div class="zatify_panel_btn" style="margin-top: 10px;">
                    <input name="" type="submit" class="btn apps_btn apps_gray_btn" value="Save" />
                    <a href="@Url.Action("List", "Rates")">
                        <input name="" type="button" class="btn apps_btn apps_gray_btn" value="Cancel" /></a>
                </div>
            </div>
        </fieldset>
    }
    @using (Html.BeginForm("SaveUsersRegisteredOutsideOfAreas", "Rates"))
    {
        <fieldset>
            <legend>
                <h4>
                    Users Registered Outside Of</h4>
            </legend>
            <div class="rates_content">
                <div class="zatify_table_content cms_dafults_content">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <th width="48%">
                                Area
                            </th>
                            <th width="37%">
                                Rate Per Push
                            </th>
                            <th width="15%">
                                Fixed Cost
                            </th>
                        </tr>
                        @for (int i = 0; i < Model.ProximityRadiusOutside.Count(); i++)
                        {
                            <tr>
                                <td>
                                    @Html.HiddenFor(m => m.ProximityRadiusOutside[i].ProximityRadiusOutsideCode)
                                    @Model.ProximityRadiusOutside[i].Description
                                </td>
                                <td>
                                    @Html.EditorFor(m => m.ProximityRadiusOutside[i].RatePerPush)
                                </td>
                                <td>
                                    @Html.EditorFor(m => m.ProximityRadiusOutside[i].FixedCost)
                                </td>
                            </tr>
                        }
                    </table>
                </div>
                <div class="zatify_panel_btn" style="margin-top: 10px;">
                    <input name="" type="submit" class="btn apps_btn apps_gray_btn" value="Save" />
                    <a href="@Url.Action("List", "Rates")">
                        <input name="" type="button" class="btn apps_btn apps_gray_btn" value="Cancel" />
                    </a>
                </div>
            </div>
        </fieldset>
    }
    <div class="clearfix">
    </div>
</div>
<div class="clearfix">
</div>
<!--end add new part-->
